home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 August / August CD.bin / Shareware / Education / numericalmethods Folder / chap_5 / crvfun.m < prev    next >
Encoding:
Text File  |  1994-06-05  |  647 b   |  23 lines  |  [MATF/MATL]

  1. function z = crvfun(Clist,ct,x)
  2. % z = crvfun(Clist,ct,x)
  3. % Evaluates the function created with crvfit.m
  4. % Clist is the coefficient list, input.
  5. % ct is the curve type, input.
  6. % x is the input value(s), input.
  7. % z is the function value(s), output.
  8. A = Clist(1);
  9. B = Clist(2);
  10. C = Clist(3);
  11. D = Clist(4);
  12. L = Clist(5);
  13. if ct==1, z = A./x + B; end
  14. if ct==2, z = D./(x + C); end
  15. if ct==3, z = (A.*x + B).^(-1); end
  16. if ct==4, z = x./(A + B.*x); end
  17. if ct==5, z = A*log(x) + B; end
  18. if ct==6, z = C*exp(A.*x); end
  19. if ct==7, z = C.*x.^A; end
  20. if ct==8, z = (A.*x + B).^(-2); end
  21. if ct==9, z = C.*x.*exp(-D.*x); end
  22. if ct==10,z = L./(1 + C.*exp(A.*x)); end
  23.